#include <cstdio>
#include <algorithm>
#include <cmath>
#define eps 1e-8

using namespace std;

const double pi = acos( -1 );
double a[ 100010 ];

int main( )
{
    int t, n, i;
    double p;
    bool flag;
    scanf("%d", &t);
    while ( t-- )
    {
        scanf("%d", &n);
        a[ 0 ] = 0;
        for ( i = 1; i < n + 1; i++ )
        {
            scanf("%lf", &a[ i ]);
            a[ i ] += a[ i - 1 ];
            if ( a[ i ] < 0 ) a[ i ] += 360;
            if ( a[ i ] >= 360 ) a[ i ] -= 360;
        }
        if ( n == 1 && a[ 1 ] == 180 )
        {
            puts("Yes");
            continue;
        }
        sort( a, a + n + 1 );
        flag = true;
        for ( i = 0; i < n; i++ )
            if ( a[ i + 1 ] - a[ i ] >= 180 )
            {
                flag = false;
                break;
            }
        if ( a[ n ] <= 180 )
            flag = false;
        if ( flag )
            puts("Yes");
        else
            puts("No");
        /*scanf("%lf", &p);
        if ( n == 1 )
        {
            if ( fabs( cos( p * pi / 180 ) + 1 ) <= eps )
                puts("Yes");
            else
                puts("No");
            continue;
        }
        p += a[ n - 1 ];
        if ( p < 0 ) p += 360;
        if ( p >= 360 ) p -= 360;
        p = 360 - p;
        sort( a, a + n );
        flag = false;
        for ( i = 0; i < n - 1; i++ )
        {
            if ( sin( ( a[ i + 1 ] - a[ i ] ) * pi / 180 ) + eps < 0 )
                continue;
            if ( sin( ( p - a[ i ] ) * pi / 180 ) + eps >= 0 && sin( ( a[ i + 1 ] - p ) * pi / 180 ) + eps >= 0 )
            {
                flag = true;
                break;
            }
        }
        if ( sin( ( a[ 0 ] - a[ n - 1 ] ) * pi / 180 ) + eps >= 0 && sin( ( p - a[ n - 1 ] ) * pi / 180 ) + eps >= 0 && sin( ( a[ 0 ] - p ) * pi / 

180 ) + eps >= 0 )
            flag = true;
        if ( flag )
            puts("Yes");
        else
            puts("No");*/
    }
    return 0;
}
